package cn.web.web_module.service.impl;

import cn.itcast.mapper.horsemanMapper;
import cn.itcast.mapper.userMapper;
import cn.itcast.pojo.horseman;
import cn.web.web_module.service.UserBindHorsemanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: 张松
 * @Description:
 * @Date: Created in 19:18 2020/12/29
 * @Modified By:
 */
@Service
public class UserBindHorsemanServiceImpl implements UserBindHorsemanService {

    @Autowired
    private horsemanMapper horsemanMapper;

    @Autowired
    private userMapper userMapper;

    @Override
    public List<horseman> findHorsemanAccount(String horsemanPhone) {
        List<horseman> horsemen = horsemanMapper.selectHorsemanphone(horsemanPhone);
        return horsemen;
    }

    @Override
    public Integer bindHorsemanPhone(String userOpenid, String horsemanPhone) {

        return userMapper.userBindHorsemanPhone(userOpenid, horsemanPhone);
    }

    @Override
    public Integer relieveUserBindHorseman(String userOpenId) {
        return userMapper.relieveUserBindHorseman(userOpenId);
    }
}
